package uutalk.netcloud.talk.app.ui.adapter;

import android.content.Intent;
import android.util.Log;
import android.view.Gravity;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import uutalk.netcloud.talk.R;
import uutalk.netcloud.talk.app.Constants;
import uutalk.netcloud.talk.app.ui.Activity.GroupMainActivity;
import uutalk.netcloud.talk.app.ui.ContentActivity;
import uutalk.netcloud.talk.base.widget.CenterWindowTips;
import uutalk.netcloud.talk.model.bean.FriendInfoBean;
import uutalk.netcloud.talk.model.bean.GroupInfoBean;
import uutalk.netcloud.talk.model.bean.SimpleEvent;
import uutalk.netcloud.talk.model.bean.SimpleEventType;

/**
 * 类描述：
 * 作者：Pengmutian
 * 时间：2018/5/11
 */
public class GroupListAdapter extends BaseQuickAdapter<GroupInfoBean, BaseViewHolder> {
    public GroupListAdapter(List data) {
        super(R.layout.item_group_list, data);
    }
    @Override
    protected void convert(BaseViewHolder helper, GroupInfoBean item) {
        helper.setText(R.id.tvName, item.getGroup_name());
        final String groupID = item.getGroup_id();
        helper.itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(mContext, GroupMainActivity.class);
                intent.putExtra(Constants.KEY_UID, item.getGroup_id());
                intent.putExtra(Constants.KEY_TITLE, item.getGroup_name());
                mContext.startActivity(intent);
            }
        });
    }
}
